home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
dbase
/
qfile.lha
/
QuickFile3
/
ARexx
/
Address.xdme
next >
Wrap
Text File
|
1995-11-19
|
2KB
|
100 lines
/*
This is an XDME macro to get an address from a QuickFile addressbook
and insert it into the current document
Called from xdme with command "rx1 address lastname"
This also works with DME but needs "rx1 address.xdme lastname"
Should be easy to adapt to a word processor
*/
options results
parse arg name
address "QUICKFILE.01"
/*
Try to find the QuickFile addressbook
*/
"setfile"
if rc > 0 then
call ErrorProc "Error from setfile command"
if upper(result) ~= "ADDRESSBOOK" then
do
"setfile addressbook"
if rc > 0 then do
"openfile 'QuickFile:QuickFile3/Examples/AddressBook/AddressBook'"
if rc > 0 then
call ErrorProc "Cannot find addressbook file"
end
end
/*
Find the right record
*/
"goto" name /* find the record - exact match not required */
/*
Get the field values
*/
"GETFIELD Lastname"
lastname = result
"getfield FirstName"
firstname = result
"getfield Street"
street = result
"getfield Place"
place = result
"getfield state"
state = result
"GETFIELD Country"
country = result
"getfield Postcode"
postcode = result
/*
Pass them back to XDME. The results should like
Alan Wigginton
23 Carissa Street
Shailer Park QLD 4128
Australia
Dear Alan,
*/
address /* send commands back to original host */
"("firstname Lastname")" /* This inserts text into the document */
"return" /* This goes to the next line */
"("street")"
"return"
"("place state postcode")"
"return"
"("country")"
"return"
"return"
"return"
"(Dear" firstname",)"
"return"
"return"
exit
/*-------------------------------
Return an error string
-------------------------------*/
ErrorProc:
parse arg msg
address
"("msg")"
exit